-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.

- import it._
- val helper = new org.apache.activemq.apollo.web.resources.ViewHelper
- import helper._

h1 Apache ActiveMQ Apollo #{version}
p state: #{state} #{ uptime(state_since) } ago

a(href={path("config/files.html")}) Edit Configuration
- if( state == "STARTED" )
  form(method="post" action={path("action/shutdown")})
    input(type="submit" value="shutdown")

h2 Virtual Hosts
ul
  - for( x <- virtual_hosts )
    li
      a(href={ path("virtual-hosts/"+x+".html") }) #{x}

h2 Connectors

ul
  - for( x <- connectors )
    li
      a(href={ path("connectors/"+x+".html") }) #{x}

h2 Connections
p currently connected : #{connected}
p total connections since startup : #{connection_counter}
p messages received from connections: #{messages_received}
p messages sent to connections: #{messages_sent}
p bytes read from connections: #{memory(read_counter)}
p bytes written to connections: #{memory(write_counter)}
p
  - if( connections==null )
    a(href={ "broker.html?connections=true" }) Show Connections
  - else
    a(href={ "broker.html" }) Hide Connections
    ul
      - for( x <- connections )
        li
          a(href={ path("connections/"+x.id+".html") }) #{x.label}

h2 Operating System
p Name : #{jvm_metrics.os_name}
p Architecture : #{jvm_metrics.os_arch}
p Memory total : #{memory(jvm_metrics.os_memory_total)}
p Memory free : #{memory(jvm_metrics.os_memory_free)}
p Swap total : #{memory(jvm_metrics.os_swap_total)}
p Swap free : #{memory(jvm_metrics.os_swap_free)}
p File descriptors open: #{jvm_metrics.os_fd_open}
p File descriptors max: #{jvm_metrics.os_fd_max}

h2 Java Virtual Machine
p Name: #{jvm_metrics.jvm_name}
p Runtime : #{jvm_metrics.runtime_name}
p Start time : #{ new java.util.Date(jvm_metrics.start_time) }
p Up time : #{ uptime(jvm_metrics.start_time) }

h2 Memory
p Heap memory used : #{memory(jvm_metrics.heap_memory.used)}
p Heap memory allocated : #{memory(jvm_metrics.heap_memory.alloc)}
p Heap memory max : #{memory(jvm_metrics.heap_memory.max)}
p Non-heap memory allocated : #{memory(jvm_metrics.non_heap_memory.alloc)}

h2 Classes
p Classes loaded : #{jvm_metrics.classes_loaded}
p Classes unloaded : #{jvm_metrics.classes_unloaded}

h2 Threads
p Threads current : #{jvm_metrics.threads_current}
p Threads peak : #{jvm_metrics.threads_peak}

